package models;


import play.db.jpa.Model;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: Caslav
 * Date: 4/13/12
 * Time: 8:06 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class Comment extends Model {

    public String content;
    public Date createdOn;
    public Date deletedOn;

    @ManyToOne
    public User commentedBy;

    @ManyToOne
    public User deletedBy;

    @ManyToOne
    public User commentForUser;

    @ManyToOne
    public Object commentForObject;

    @Override
    public String toString() {
        return "Comment from "+this.commentedBy.username+": "+this.content;    //To change body of overridden methods use File | Settings | File Templates.
    }
}
